﻿using System;

namespace ContactCenter.Core.DomainModel
{
    public class Address
    {
        public virtual int AddressId { get; protected set; }
        public virtual Customer Customer { get; set; }
        public virtual string Street { get; set; }
        public virtual string PostalCode { get; set; }
        public virtual string City { get; set; }
        public virtual string Region { get; set; }
        

        [Obsolete("For NH only", true)]
        public Address() { }

        public Address(Customer customer, string street, string postalCode, string city, string region)
        {
            Customer = customer;
            Street = street;
            PostalCode = postalCode;
            City = city;
            Region = region;
        }

        public override int GetHashCode()
        {
            return AddressId.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            var other = obj as Address;
            if (other == null) return false;
            return (other.AddressId == AddressId);
        }
    }
}
